/**
 * Copyright 2024 NoEvaa
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "testlib.h"
#include "aystl/utility/common.hpp"

using namespace iin;

TEST_CASE("overload") {
    struct TO1 { int operator()(int) { return 1; } };
    struct TO2 { int operator()(double) { return 2; } };
    struct TO3 { int operator()(bool) { return 3; } };
    auto test_op = overload(TO1{}, TO2{}, TO3{});
    CHECK(test_op(0) == 1);
    CHECK(test_op(0.) == 2);
    CHECK(test_op(true) == 3);
}

